<?php
    $masterView = MasterView::getInstance();
    foreach($masterView->folderView->folderTypes as $key=>$folderType) : ?>
    <ul>
        <li class="folder-tab list-separator"><span class="context-type"><?php echo $folderType->name ?></span> <span class="separator-line"></span></li>
        <?php foreach($masterView->folderView->folders[$key] as $folder) :
            $streams = StreamController::getStream($folder->folderId);?>
            <li class="mozaic-widget folder-tab first mozaic-initialized widget-folder_with_streams" data-guid="widget-499" data-params="{&quot;isLoadedLater&quot;:false,&quot;id&quot;:1000091437,&quot;channels&quot;:{&quot;/folders&quot;:&quot;/folders-1&quot;,&quot;/streams&quot;:&quot;/streams-2&quot;,&quot;/social_profiles&quot;:&quot;/social_profiles-5&quot;}}" data-widget="folder_with_streams">
                <!--start template: templates/folder_with_streams.hjs -->
                <a class="expand-folder expanded-folder <?php echo (count($streams) > 0 ? "" : "folder-fade"); ?>"><strong></strong> <i class="icon-folder"></i> <span><?php echo $folder->folderName; ?></span></a>
                <ul class="full-menu mozaic-widget widget-list" data-guid="widget-559" data-initialized="true" data-params="{&quot;item_channels&quot;:{&quot;/streams&quot;:&quot;/streams-2&quot;,&quot;/folders&quot;:&quot;/folders-1&quot;},&quot;filter_by&quot;:{&quot;folder_id&quot;:1000091437},&quot;sort_by&quot;:{&quot;name&quot;:&quot;str&quot;},&quot;item_class&quot;:&quot;folder-tab&quot;,&quot;item&quot;:&quot;stream_in_folder&quot;,&quot;channels&quot;:{&quot;/items&quot;:&quot;/streams-2&quot;}}" data-widget="list">
                    <!--start template: templates/list.hjs -->
                    <!-- Empty list template -->
                    <!-- end template: templates/list.hjs -->
                <?php 
                    
                    if (count($streams) > 0) :
                    foreach($streams as $stream): ?>
                    <li class="mozaic-widget item-1000005765 folder-tab first widget-stream_in_folder" data-guid="widget-583" data-id="1000005765" data-initialized="true" data-params="{&quot;isLoadedLater&quot;:false,&quot;id&quot;:&quot;1000005765&quot;,&quot;channels&quot;:{&quot;/streams&quot;:&quot;/streams-2&quot;,&quot;/folders&quot;:&quot;/folders-1&quot;}}" data-widget="stream_in_folder">
                        <!--start template: templates/stream_in_folder.hjs -->
                        <a class="keyword type-keyword" data-id="<?php echo $stream->streamId; ?>" data-type="keyword" href="/buzzPulse/#stream/<?php echo base64_encode($stream->streamId); ?>"><strong></strong> <i class="icon-stream-type icon-stream-company-small"></i> <span><?php echo $stream->name; ?></span></a> <!-- end template: templates/stream_in_folder.hjs -->
                    </li>
                <?php endforeach;
                    else:
                ?>
                    <li class="mozaic-widget folder-tab widget-permission_button" data-widget="permission_button" data-params="{&quot;channels&quot;:{&quot;/items&quot;:&quot;/streams-2&quot;,&quot;/social_profiles&quot;:&quot;/social_profiles-5&quot;},&quot;type_of_object&quot;:&quot;streams&quot;,&quot;action&quot;:&quot;add&quot;,&quot;button_text&quot;:&quot;Add Stream&quot;,&quot;button_class&quot;:&quot;empty-company folder-fade&quot;,&quot;button_icon&quot;:&quot;icon-stream-type icon-plus&quot;}" data-guid="widget-571" data-initialized="true">
                        <a class="has_permission empty-company folder-fade">
                            <i class="icon-stream-type icon-plus"></i>
                            <span>Add Stream</span>
                        </a>
                    </li>
                <?php
                    endif;
                ?>
                </ul>
            </li>
        <?php endforeach; ?>
    </ul>
<?php endforeach; ?>